/***********************************************************************
    filename:   FalStaticImage.cpp
    created:    Tue Jul 5 2005
    author:     Paul D Turner <paul@cegui.org.uk>
*************************************************************************/

#include "renderers/StaticImageRenderer.h"
const String StaticImageRenderer::TypeName = "Renderers/StaticImage";

RendererProperties::Image    StaticImageRenderer::d_imageProperty;

StaticImageRenderer::StaticImageRenderer(const String& type) :
    StaticRenderer(type),
    d_image(0)
{
    registerProperty(&d_imageProperty);
}

void StaticImageRenderer::render()
{
    // base class rendering
    StaticRenderer::render();

    // render image if there is one
    if (d_image!=0)
    {
        // get WidgetLookFeel for the assigned look.
        d_window->getImagerySection("Enabled").render(*d_window);
    }
}

void StaticImageRenderer::setImage(const Image* img)
{
    d_image = img;
    d_window->invalidate();
}
